Security News
RubyGems.org Adds New Maintainer Role
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
@aws-sdk/shared-ini-file-loader
Advanced tools
[![NPM version](https://img.shields.io/npm/v/@aws-sdk/shared-ini-file-loader/rc.svg)](https://www.npmjs.com/package/@aws-sdk/shared-ini-file-loader) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/shared-ini-file-loader.svg)](https://www.npmjs.co
@aws-sdk/shared-ini-file-loader is a package from the AWS SDK for JavaScript that provides utilities for loading and parsing AWS credentials and configuration from INI files. This is particularly useful for managing multiple AWS profiles and credentials in a standardized way.
Load AWS Credentials from INI File
This feature allows you to load AWS credentials from the shared INI file. The `loadSharedConfigFiles` function reads the credentials and configuration files and returns their contents.
const { loadSharedConfigFiles } = require('@aws-sdk/shared-ini-file-loader');
async function loadCredentials() {
const { credentialsFile } = await loadSharedConfigFiles();
console.log(credentialsFile);
}
loadCredentials();
Load AWS Configurations from INI File
This feature allows you to load AWS configurations from the shared INI file. The `loadSharedConfigFiles` function reads the configuration file and returns its contents.
const { loadSharedConfigFiles } = require('@aws-sdk/shared-ini-file-loader');
async function loadConfig() {
const { configFile } = await loadSharedConfigFiles();
console.log(configFile);
}
loadConfig();
Parse Specific Profile
This feature allows you to parse and load a specific AWS profile from the shared INI files. The `parseKnownFiles` function can be used to specify which profile to load.
const { parseKnownFiles } = require('@aws-sdk/shared-ini-file-loader');
async function loadProfile(profileName) {
const { credentialsFile, configFile } = await parseKnownFiles({ profile: profileName });
console.log(credentialsFile[profileName], configFile[profileName]);
}
loadProfile('my-profile');
The `aws-sdk` package is the official AWS SDK for JavaScript. It provides a comprehensive set of tools for interacting with AWS services, including loading credentials and configurations. However, it is a much larger package with a broader scope compared to `@aws-sdk/shared-ini-file-loader`.
This module provides a function that reads from AWS SDK configuration files and
returns a promise that will resolve with a hash of the parsed contents of the
AWS credentials file and of the AWS config file. Given the sample
files below, the promise returned by loadSharedConfigFiles
would resolve with:
{
configFile: {
'default': {
aws_access_key_id: 'foo',
aws_secret_access_key: 'bar',
},
dev: {
aws_access_key_id: 'foo1',
aws_secret_access_key: 'bar1',
},
prod: {
aws_access_key_id: 'foo2',
aws_secret_access_key: 'bar2',
},
'testing host': {
aws_access_key_id: 'foo4',
aws_secret_access_key: 'bar4',
}
},
credentialsFile: {
'default': {
aws_access_key_id: 'foo',
aws_secret_access_key: 'bar',
},
dev: {
aws_access_key_id: 'foo1',
aws_secret_access_key: 'bar1',
},
prod: {
aws_access_key_id: 'foo2',
aws_secret_access_key: 'bar2',
}
},
}
If a file is not found, its key (configFile
or credentialsFile
) will instead
have a value of an empty object.
You may customize how the files are loaded by providing an options hash to the
loadSharedConfigFiles
function. The following options are supported:
filepath
- The path to the shared credentials file. If not specified, the
provider will use the value in the AWS_SHARED_CREDENTIALS_FILE
environment
variable or a default of ~/.aws/credentials
.configFilepath
- The path to the shared config file. If not specified, the
provider will use the value in the AWS_CONFIG_FILE
environment variable or a
default of ~/.aws/config
.~/.aws/credentials
[default]
aws_access_key_id=foo
aws_secret_access_key=bar
[dev]
aws_access_key_id=foo2
aws_secret_access_key=bar2
[prod]
aws_access_key_id=foo3
aws_secret_access_key=bar3
~/.aws/config
[default]
aws_access_key_id=foo
aws_secret_access_key=bar
[profile dev]
aws_access_key_id=foo2
aws_secret_access_key=bar2
[profile prod]
aws_access_key_id=foo3
aws_secret_access_key=bar3
[profile "testing host"]
aws_access_key_id=foo4
aws_secret_access_key=bar4
FAQs
[![NPM version](https://img.shields.io/npm/v/@aws-sdk/shared-ini-file-loader/latest.svg)](https://www.npmjs.com/package/@aws-sdk/shared-ini-file-loader) [![NPM downloads](https://img.shields.io/npm/dm/@aws-sdk/shared-ini-file-loader.svg)](https://www.npmj
The npm package @aws-sdk/shared-ini-file-loader receives a total of 2,541,209 weekly downloads. As such, @aws-sdk/shared-ini-file-loader popularity was classified as popular.
We found that @aws-sdk/shared-ini-file-loader demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 5 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.
Security News
Research
Socket's threat research team has detected five malicious npm packages targeting Roblox developers, deploying malware to steal credentials and personal data.